<link rel="stylesheet" href="__PUBLIC__/bootstrap/css/bootstrap.min.css">
	<link href="__PUBLIC__/bootstrap/css/bootstrap.datepicker/bootstrap-datepicker3.min.css" rel="stylesheet" />
	<script src="__PUBLIC__/bootstrap/js/jquery.min.js"></script>
	<script src="__PUBLIC__/bootstrap/js/bootstrap/bootstrap.min.js"></script>
	 <script src="__PUBLIC__/bootstrap/js/bootstrap.datepicker/js/bootstrap-datepicker.min.js"></script>
    <script src="__PUBLIC__/bootstrap/js/bootstrap.datepicker/locales/bootstrap-datepicker.zh-CN.min.js"></script>
    <style type="text/css">
		#form-group{
			padding: 5px 0;
		}
    </style>
<div style="margin: 10px">
<button class="btn btn-primary"  href="{:U('Depart/Dwg/add_dwg')}" data-toggle="modal" data-target="#myModal">新增</button> 
<div class="modal fade" id="myModal" tabindex="1">
	<div class="modal-dialog" >
		<div class="modal-content">
		</div>
	</div>
</div>
<table class="table  table-bordered  table-hover">
	<caption style="text-align: center">图纸清单一览表</caption>
	<thead style="text-align: center">
		<tr>
			<th>图号</th>
			<th>图纸名称</th>
			<th>型号规格</th>
			<th>类别</th>
			<th>容积</th>
			<th>介质</th>
			<th>工作压力</th>
			<th>立/卧</th>
			<th>产品分类</th>
			<!-- <th>设计日期</th> -->
			<!-- <th>设计人</th> -->
			<th>操作</th>
		</tr>
	</thead>
	<tbody>
		<foreach name='dwgs' item="v">
			<tr>
				<td>{$v['dwgcode']}</td>
				<td>{$v['dwgname']}</td>
				<td>{$v['spec']}</td>
				<td>{$v['category']}</td>
				<td>{$v['volume']}</td>
				<td>{$v['medium']}</td>
				<td>{$v['wpressure']}</td>
				<td>{$v['mode']}</td>
				<td>{$v['hv']}</td>
				<!-- <td>{$v['date']|date='Y.m',###}</td> -->
				<!-- <td>{$v['dname']}</td> -->
				<td>
					<a href="javascript:;" dwgid="{$v['id']}" dwgname="{$v['dwgname']}" dwgcode="{$v['dwgcode']}" onclick="edit(this)">修改</a> |
					<a href="javascript:if(confirm('确定删除？'))location='{:U('Depart/Dwg/del_dwg',array('id'=>$v['id']))}'">删除</a>
				</td>
			</tr>
		</foreach>
	</tbody>
</table>
</div>
<!-- 修改菜单模态框开始 -->
<div class="modal fade" id="dwg-edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		 <div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					&times;
				</button>
				<h4 class="modal-title" id="myModalLabel">
					修改图纸信息
				</h4>
			</div>
			<div class="modal-body">
				<form id="dwg-form" class="form-inline" action="{:U('Depart/Dwg/edit_dwg')}" method="post">
					<input type="hidden" name="id">
					<table class="table table-striped table-bordered table-hover table-condensed">
						<tr>
							<th width="20%">图纸名称：</th>
							<td>
								<input class="form-control" type="text" name="dwgname">
							</td>
						</tr>
						<tr>
							<th>图号：</th>
							<td>
								<input class="form-control" type="text" name="dwgcode"> 
							</td>
						</tr>
						<tr>
							<th></th>
							<td>
								<input class="btn btn-success" type="submit" value="修改">
							</td>
						</tr>
					</table>
				</form>
			</div>
		</div>
	</div>
</div>
<!-- 修改菜单模态框结束 -->
<script type="text/javascript">
	// 修改菜单
function edit(obj){
	var dwgid=$(obj).attr('dwgid');
	var dwgcode=$(obj).attr('dwgcode');
	var dwgname=$(obj).attr('dwgname');
	$("input[name='id']").val(dwgid);
	$("input[name='dwgcode']").val(dwgcode);
	$("input[name='dwgname']").val(dwgname);
	$('#dwg-edit').modal('show');
}
	
</script>